INCLUDEPATH += $$PWD

####  Windows ### - Begin
win32{

#    QMAKE_CFLAGS_DEBUG += -MT
#    QMAKE_CXXFLAGS_DEBUG += -MT

#    QMAKE_CFLAGS_RELEASE += -MT
#    QMAKE_CXXFLAGS_RELEASE += -MT

    INCLUDEPATH +=  $$PWD/include

	contains(QT_ARCH, i386) {
		LIBS += -L$$PWD/lib/x86 -lgrpc -laddress_sorting -lgpr -lgrpc_csharp_ext -lgrpc_plugin_support -lgrpc_unsecure -lgrpc++ -lgrpc++_alts -lgrpc++_error_details -lgrpc++_unsecure -lgrpc++_reflection -lupb

        LIBS += -L$$PWD/third_party/protobuf/lib/x86 -llibprotobuf -llibprotoc
        LIBS += -L$$PWD/third_party/abseil-cpp/absl/lib/x86 -labsl_base -labsl_city -labsl_cord -labsl_hash -labsl_time -labsl_int128 \
                -labsl_status -labsl_strings -labsl_statusor -labsl_symbolize -labsl_time_zone -labsl_civil_time -labsl_stacktrace -labsl_log_severity \
                -labsl_raw_hash_set -labsl_spinlock_wait -labsl_throw_delegate -labsl_malloc_internal -labsl_synchronization -labsl_strings_internal \
                -labsl_demangle_internal -labsl_bad_variant_access -labsl_debugging_internal -labsl_exponential_biased -labsl_hashtablez_sampler \
                -labsl_bad_optional_access -labsl_str_format_internal -labsl_graphcycles_internal -labsl_raw_logging_internal -labsl_flags_reflection
        LIBS += -L$$PWD/third_party/re2/lib/x86 -lre2
        LIBS += -L$$PWD/third_party/cares/lib/x86 -lcares
        LIBS += -L$$PWD/third_party/boringssl-with-bazel/lib/x86 -lcrypto -lssl

        LIBS += -L$$PWD/third_party/zlib/lib/x86 -lzlibstatic
	} else {
		CONFIG(debug,debug|release){
		
		}
		else{
		
		}
	}

}
####  Windows  ### - End


unix{

	INCLUDEPATH += $$PWD/include

    contains(QT_ARCH, i386) {
        message("32-bit, 请自行编译32位库!")
    } else {
        message("64-bit")

        LIBS += -L$$PWD/lib/x64 -lgrpc -laddress_sorting -lgpr -lgrpc_csharp_ext -lgrpc_plugin_support -lgrpc_unsecure -lgrpc++ -lgrpc++_alts -lgrpc++_error_details -lgrpc++_unsecure -lgrpc++_reflection -lupb
    }


#QMAKE_POST_LINK 表示编译后执行内容
#QMAKE_PRE_LINK 表示编译前执行内容

#解压库文件
#QMAKE_PRE_LINK += "cd $$PWD/ && tar xvzf grpc-1.37.0-linux_x64_gcc4.8.5.tar.gz "
system("cd $$PWD/ && tar xvzf grpc-1.37.0-linux_x64_gcc4.8.5.tar.gz")
}